
public class JNIDemo {
	static {
		//1. load C library
		System.loadLibrary("native");  //libnative.so

	}
	//declare the function hello() ,no definition ,the definition is C program in native
	//public native static void hello();   
	public native int[]  hello(int[] a);
	public static void main(String args[]) {
		JNIDemo d = new JNIDemo();
		int [] a = {1, 2, 3};
		int [] b = null;
		int i = 0;

		//2. map java hello <----> C hello

		//3. call
		b = d.hello(a);
		for (i = 0 ; i < b.length; i++) {
			System.out.println(b[i]);
		}

	}
	
}











